Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Programmer's Overview / Part 1 - Getting Started With QuickDraw GX
Chapter 2 - A Quick & Easy Sample Program


Creating a Curve Shape

The GXNewShape function takes one parameter--the type of shape to create--and returns a reference to the new shape. To store this shape reference, you need to declare a shape reference variable, which you can do using this declaration:

gxShape  aCurveShape;
To create a curve shape, call the GXNewShape function, using the gxCurveType constant to specify that you want to create a curve shape:

aCurveShape = GXNewShape(gxCurveType);
QuickDraw GX responds to this function call by creating a new shape object, initializing the values of its properties, and returning a reference to it.

Note
In this example, when you call the GXNewShape function, QuickDraw GX notices that your application doesn't yet have a graphics client heap. Therefore, QuickDraw GX automatically creates one for you. By default, the size of this heap is 600K.
After the call to the GXNewShape function, you can use the shape reference stored in your aCurveShape variable to examine the values stored in the properties of the shape and also to modify the values of those properties.

Figure 2-2 shows the properties of a shape object. All shape objects have the same nine properties.

Figure 2-2 A shape object and its properties

The following list describes the purpose of these properties and discusses the initial value of each property as set by QuickDraw GX when creating your curve shape object:

As you can see, that's a lot of results for a single function call! In this example, the call to the GXNewShape function


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996